package com.tc.controller;

import com.tc.R;
import com.tc.entity.Order;
import com.tc.service.MyOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: wangyifan
 * @Date: 2022/03/03 11:29
 * @Description: $end$
 * @Version: V1.0
 */
@RestController
@RequestMapping("/MyOrder")
public class MyOrderController {

    @Autowired(required = false)
    private MyOrderService myOrderService;

/**新增订单接口，订单支付后修改商品库存、增加员工账户提成*/
    @GetMapping("/addOrder")
    public R addMyOrder(@RequestBody Order order){
        R r = myOrderService.addOrder(order);


        return r;
    }
}
